Repository navigation
feat(hub): desktop notifications for what needs attention (ADR-0045) - #161
Merged
Merged
Conversation
The hub follows every running stack and each of its started lanes (on a node too, through the stack's daemon) and tells the desktop when a build failed, a candidate is held for promote, a service exited by itself or failed to start, or a lane's start or move on a node failed; on request also when a lane took the main ports or a candidate went live. Only changes notify, and the same kind for the same service once in five minutes, so a crash loop is one notification. Windows: a WinRT toast under an AppUserModelID the hub registers in HKCU (no shortcut, no admin rights). Linux: org.freedesktop.Notifications over the session bus with zbus, so the binary stays static; without a session bus nothing shows and the hub says why. A click opens the dashboard on the stack, lane and service: a `devstack://open` link on Windows, the hub itself on Linux; `/auth` takes `next` (a dashboard route only) and keeps the session of a browser that is paired already. Settings per machine in the hub (notify.json): each kind on or off, a mute per stack or lane. GET/PUT /hub/notify, POST /hub/notify/test, the bell in the dashboard's top bar, `devstack hub notify`. DEVSTACK_NO_NOTIFY switches them off. Also fixed on the way: `--browser`/DEVSTACK_BROWSER on Windows cut an address at `&` (cmd); the dashboard opened on a lane before it knew the stack runs showed the lane without its list of lanes. Refs #156 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # CHANGELOG.md # docs/adr/README.md
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements #156. ADR-0045 is
Proposed: per ADR-0001 it needs the owner's acceptance before this merges (then adocs(adr): ADR-0045 acceptedcommit, as for ADR-0044).What
The hub follows every running stack and each of its started lanes (local, or on a node through the stack's daemon) and notifies the desktop:
build_failed: a candidate's build failed, or a service's build at its startheld: a candidate is held and waits forpromoteservice_failed: a service exited by itself, or failed to startlane_failed: a lane's start or move on a node failedmain_ports: a lane took or gave back the main portslive: a candidate went livedevstack.hub, registered inHKCU\Software\Classes\AppUserModelId. No Start-menu shortcut and no admin rights are needed (measured, see the ADR).self uninstallremoves it.org.freedesktop.Notificationsover the session bus viazbus, which is pure Rust, so the musl binary staysstatic-pie linked. Without a session bus nothing shows and the hub says why.devstack://open?stack=…&lane=…&service=…, which pairs the browser likedevstack uidoes.ActionInvokeditself and opens the dashboard./authtakesnext(a dashboard route only), and a browser that is already paired keeps its session.notify.jsonin the hub's state): each kind on or off, and a mute per stack or lane.GET/PUT /hub/notify,POST /hub/notify/test.devstack hub notify [on|off <kind>…|all|test].DEVSTACK_NO_NOTIFY=1turns them off; the hub test harness sets it.devstack://openlink.Fixed along the way
--browser/DEVSTACK_BROWSERon Windows:cmd /c startcut an address at&. The address is now passed in quotes, andweb_urlrefuses".watch(running)now loads the lanes.Tested
notify::rules: baseline, failed or held candidates, crash vs. stop, lanes./authnext, thedevstack://openparser, toast XML escaping.tests/hub.rs, new tests:/auth?next=with and without an existing session.service_failednotice, with no dashboard open.launchisdevstack://open?stack=…&service=api.devstack open-urlwith that link → a paired URL →303to/#/s/<id>/services/api?lane=feat-x.rust:latest):python-dbusmocknotification daemon,Notifyarrives with the right arguments, and a simulatedActionInvokedmakes the hub open the dashboard.static-pie linked. Without a desktop session: "no desktop session (no D-Bus session bus …)".?lane=deep link on a first visit.cargo fmt --check,cargo clippy --workspace --all-targets -- -D warnings,cargo test --workspace,npm run typecheck,npm test.Notes
windows0.62 (Windows only) andzbus6 (Linux only). All new crates in the lock file are MIT or Apache-2.0.docs/adr/README.mdwill conflict trivially with feat(prepare): link a lane's prepared directories into its worktree (ADR-0044) #160 (ADR-0044 row).Closes #156
🤖 Generated with Claude Code